% File:     uc-preform-simulation.tex
% Author:   Adam K. Patterson
% Date:     2007-10-23
% Desc:     This use case describes the user loading and then executing a full simulation.
% Rev:      [2007-10-23, Adam K. Patterson] First revision from template provided by Ryan Bovorasmy.
%						[2007-10-25, Adam K. Patterson] Updated during checklist review
% 					[2007-11-1, Adam K. Patterson] Converted from several smaller use cases into one larger one.
%
%||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
%
% BEGIN COMMAND SECTION
% Do Not edit this section unless you know what you are doing.
%
\providecommand{\usecase}{~}
\providecommand{\usehistory}{~}
\providecommand{\uc}{UC\theusecase}
\providecommand{\actor}{~}
\providecommand{\system}{~}
\setcounter{flownumber}{0}
\providecommand{\flowcounter}{\addtocounter{flownumber}{1} \theflownumber}
%
% END COMMAND SECTION
%
%||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

%==============================================================================
%
% BEGIN VARIABLE SECTION
%
% *** Enter the name of the use case here:
%
\renewcommand{\usecase}{User Preforms a Simulation}
%
% *** Enter the revision history here.
% The format of the history command is as follows:
%
% \history{NAME}{DATE}{BRIEF DESCRIPTION\\}
%
% Notice that a newline is REQUIRED after the description.
%
\renewcommand{\usehistory}%
{%
  \history{Adam K. Patterson}{2007-10-23}{First version from template.\\}
  \history{Adam K. Patterson}{2007-10-25}{Updated during checklist review.\\}
	\history{Adam K. Patterson}{2007-11-1} Converted from several smaller use cases into one larger one.\\}}
%
% END VARIABLE SECTION
%
%==============================================================================
\addtocounter{usecase}{1}
\subsection{\uc{}: \usecase{}}

%------------------------------------------------------------------------------
% Do not edit this.
%
\paragraph{\uc{}: Revision History}~\\{}
\begin{table}[htbp]
  \begin{tabular}{|l|l|p{.4\textwidth}|}
    \usehistory
    \hline
  \end{tabular}
\end{table}

%------------------------------------------------------------------------------
% *** Enter a brief description.
%
\paragraph{\uc{}: Brief Description}
This use case describes the user loading and then executing a full simulation.

% %------------------------------------------------------------------------------
% % *** Image/model
% %
% % Uncomment this section if you would like to add an image of the use case
% % here.
% %
% \paragraph{\uc{}: Model}
% If graphics are being used, add an image of the use case here.

%------------------------------------------------------------------------------
% ** Create a list of actors.
%
\paragraph{\uc{}: Actors}
\begin{description}
  \item[User] The user of the system.
  \item[ProtoVitae] The program running.
\end{description}

%------------------------------------------------------------------------------
% *** Pre-conditions.
%
\paragraph{\uc{}: Pre-Conditions}
\begin{description}
  \item[Program Active] The program has successfully been started.
  \item[Setup] The user has done all the setup for the simulation they want.
  \item[Previous Data] A set of data for a simulation has been previously saved.
\end{description}

%------------------------------------------------------------------------------
% *** Basic flow.
%
% First enter in the actor name and system name.
%
\renewcommand{\actor}{User}
\renewcommand{\system}{ProtoVitae}
\paragraph{\uc{}: Basic Flow}~\\{}~\\{}
\begin{tabular}{|c|p{.4\textwidth}|p{.4\textwidth}|}
  \hline
  \# & \actor{} & \system{} \\
  \hline
  \flowcounter{} & User selects to load simulation data. & ~ \\
  \hline
  \flowcounter{} & ~ & System displays a list of data that has been previously saved. \\
  \hline
  \flowcounter{} & User selects a set of data to load. & ~ \\
  \hline
  \flowcounter{} & ~ & System simulation information displayed. \\
  \hline
  \flowcounter{} & User informs ProtoVitae to start the simulation & ~ \\
  \hline
  \flowcounter{} & ~ & System starts simulation time flow \\
  \hline  
  \flowcounter{} & ~ & System provides a graphical view of the organisms in the current environment. \\
  \hline
  \flowcounter{} & User indicates that they wish to increase, decrease or pause simulation speed. & ~ \\
  \hline
  \flowcounter{} & ~ & System will increase, decrease or pause the speed of the simulation. \\
  \hline  
  \flowcounter{} & User indicates that they wish to resume normal simulation speed. & ~ \\
  \hline
  \flowcounter{} & ~ & System resumes normal speed of the simulation. \\
  \hline  
   \flowcounter{} & User selects an organism to view information about. & ~ \\
  \hline
  \flowcounter{} & ~ & System follows the selected organism. \\
  \hline
  \flowcounter{} & User indicates that they wish to save simulation data. & ~ \\
  \hline
  \flowcounter{} & ~ & Systems asks the user for a file location. \\
  \hline
  \flowcounter{} & User selects a file location. & ~ \\
  \hline
  \flowcounter{} & ~ & System prepares the simulation data. \\
  \hline
  \flowcounter{} & ~ & System creates a file at the selected location containing the prepared simulation data. \\
  \hline  
\end{tabular}


%------------------------------------------------------------------------------
% *** Alternative flow.
%
\paragraph{\uc{}: Alternative Flows}
\begin{description}
  \item[Cancel] Users informs system the simulation should be cancelled during run.  System acts as if duration of simulation was reached and displays results.
  \item[File Exists] If the selected file already exists, the user will be prompted to either overwrite the file, or cancel the save.
\end{description}

%------------------------------------------------------------------------------
% *** Exception flow.
%
\paragraph{\uc{}: Exception Flows}
\begin{description}
	\item[File Corruption] The data save is unloadable.  An error is displayed and the user is returned to the selection screen.
  \item[Simulation Data Error] In the event of a data error, the system shall not start the simulation.	
  \item[File Unwritable] If the selected file is unable to be written to, the system shall revert to the sate it was in before the save was initiated.  
\end{description}

%------------------------------------------------------------------------------
% *** Post-conditions.
%
\paragraph{\uc{}: Post-Conditions}
\begin{description}
  \item[Data Saved] The formatted simulation data will be stored in the selected file.
\end{description}

%------------------------------------------------------------------------------
% *** Enter any additional notes here.
%
\paragraph{\uc{}: Additional Notes}
As used in this use case, the term \emph{followed} means that the system shall display information about the selected organism, and will not de-select the organism when a new cycle of the simulation starts. \\
Simulation data, as used in this use case, refers to the following information:\\
\textbf{Standard Data:} Information about the environment setup and information about the initial organisms in the environment. \textbf{Potential Data:} Information about the results of the simulation.
Information about the results of the simulation can only be saved if the simulation is complete, but information about the environment and organisms will always be saved.
